home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / countdst / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-12-29  |  12.4 KB  |  382 lines

  1. VERSION 5.00
  2. Object = "{9BB387A1-9D3A-11D2-8D3D-006008B7789D}#3.0#0"; "CountDown.ocx"
  3. Begin VB.Form frmMain 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   9030
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   8535
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   9030
  11.    ScaleWidth      =   8535
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.Frame fraMain 
  14.       Height          =   8850
  15.       Left            =   120
  16.       TabIndex        =   0
  17.       Top             =   75
  18.       Width           =   7920
  19.       Begin VB.Frame fraMode 
  20.          Caption         =   "Mode"
  21.          Height          =   765
  22.          Left            =   5685
  23.          TabIndex        =   21
  24.          Top             =   1095
  25.          Width           =   1590
  26.          Begin VB.OptionButton optMode 
  27.             Caption         =   "Normal Clock"
  28.             Height          =   210
  29.             Index           =   1
  30.             Left            =   120
  31.             TabIndex        =   23
  32.             Top             =   480
  33.             Width           =   1320
  34.          End
  35.          Begin VB.OptionButton optMode 
  36.             Caption         =   "Count Down"
  37.             Height          =   210
  38.             Index           =   0
  39.             Left            =   120
  40.             TabIndex        =   22
  41.             Top             =   225
  42.             Value           =   -1  'True
  43.             Width           =   1320
  44.          End
  45.       End
  46.       Begin VB.Frame fraStartStop 
  47.          Caption         =   "Start/Stop"
  48.          Height          =   765
  49.          Left            =   5685
  50.          TabIndex        =   18
  51.          Top             =   330
  52.          Width           =   1590
  53.          Begin VB.OptionButton optStartStop 
  54.             Caption         =   "Stop"
  55.             Height          =   210
  56.             Index           =   1
  57.             Left            =   165
  58.             TabIndex        =   20
  59.             Top             =   495
  60.             Width           =   765
  61.          End
  62.          Begin VB.OptionButton optStartStop 
  63.             Caption         =   "Start"
  64.             Height          =   210
  65.             Index           =   0
  66.             Left            =   165
  67.             TabIndex        =   19
  68.             Top             =   240
  69.             Value           =   -1  'True
  70.             Width           =   765
  71.          End
  72.       End
  73.       Begin VB.Frame fraChanges 
  74.          Caption         =   "Days"
  75.          Height          =   765
  76.          Left            =   5685
  77.          TabIndex        =   15
  78.          Top             =   1875
  79.          Width           =   1590
  80.          Begin VB.OptionButton optShowDays 
  81.             Caption         =   "Hide"
  82.             Height          =   195
  83.             Index           =   1
  84.             Left            =   120
  85.             TabIndex        =   17
  86.             Top             =   465
  87.             Width           =   885
  88.          End
  89.          Begin VB.OptionButton optShowDays 
  90.             Caption         =   "Show"
  91.             Height          =   225
  92.             Index           =   0
  93.             Left            =   120
  94.             TabIndex        =   16
  95.             Top             =   225
  96.             Value           =   -1  'True
  97.             Width           =   900
  98.          End
  99.       End
  100.       Begin VB.OptionButton optSelect 
  101.          Caption         =   "Select"
  102.          Height          =   330
  103.          Index           =   6
  104.          Left            =   3960
  105.          Style           =   1  'Graphical
  106.          TabIndex        =   14
  107.          Top             =   6705
  108.          Width           =   1185
  109.       End
  110.       Begin VB.OptionButton optSelect 
  111.          Caption         =   "Select"
  112.          Height          =   330
  113.          Index           =   5
  114.          Left            =   255
  115.          Style           =   1  'Graphical
  116.          TabIndex        =   13
  117.          Top             =   6690
  118.          Width           =   1185
  119.       End
  120.       Begin VB.OptionButton optSelect 
  121.          Caption         =   "Select"
  122.          Height          =   330
  123.          Index           =   4
  124.          Left            =   3960
  125.          Style           =   1  'Graphical
  126.          TabIndex        =   12
  127.          Top             =   4815
  128.          Width           =   1185
  129.       End
  130.       Begin VB.OptionButton optSelect 
  131.          Caption         =   "Select"
  132.          Height          =   330
  133.          Index           =   3
  134.          Left            =   255
  135.          Style           =   1  'Graphical
  136.          TabIndex        =   11
  137.          Top             =   4890
  138.          Width           =   1185
  139.       End
  140.       Begin VB.Frame fraBorder 
  141.          Height          =   1920
  142.          Index           =   6
  143.          Left            =   3810
  144.          TabIndex        =   10
  145.          Top             =   6765
  146.          Width           =   3525
  147.          Begin y2kCountDown.CountDown CountDown1 
  148.             Height          =   1275
  149.             Index           =   6
  150.             Left            =   360
  151.             TabIndex        =   30
  152.             Top             =   480
  153.             Width           =   2910
  154.             _ExtentX        =   5133
  155.             _ExtentY        =   2249
  156.          End
  157.       End
  158.       Begin VB.Frame fraBorder 
  159.          Height          =   1920
  160.          Index           =   5
  161.          Left            =   150
  162.          TabIndex        =   9
  163.          Top             =   6765
  164.          Width           =   3525
  165.          Begin y2kCountDown.CountDown CountDown1 
  166.             Height          =   1470
  167.             Index           =   5
  168.             Left            =   120
  169.             TabIndex        =   29
  170.             Top             =   360
  171.             Width           =   3180
  172.             _ExtentX        =   5609
  173.             _ExtentY        =   2593
  174.             Style           =   5
  175.          End
  176.       End
  177.       Begin VB.OptionButton optSelect 
  178.          Caption         =   "Select"
  179.          Height          =   330
  180.          Index           =   2
  181.          Left            =   3960
  182.          Style           =   1  'Graphical
  183.          TabIndex        =   8
  184.          Top             =   3045
  185.          Width           =   1185
  186.       End
  187.       Begin VB.Frame fraBorder 
  188.          Height          =   1560
  189.          Index           =   4
  190.          Left            =   3810
  191.          TabIndex        =   7
  192.          Top             =   4920
  193.          Width           =   2565
  194.          Begin y2kCountDown.CountDown CountDown1 
  195.             Height          =   1140
  196.             Index           =   4
  197.             Left            =   240
  198.             TabIndex        =   28
  199.             Top             =   240
  200.             Width           =   2145
  201.             _ExtentX        =   3784
  202.             _ExtentY        =   2011
  203.             Style           =   4
  204.          End
  205.       End
  206.       Begin VB.Frame fraBorder 
  207.          Height          =   1560
  208.          Index           =   3
  209.          Left            =   150
  210.          TabIndex        =   6
  211.          Top             =   4920
  212.          Width           =   2565
  213.          Begin y2kCountDown.CountDown CountDown1 
  214.             Height          =   960
  215.             Index           =   3
  216.             Left            =   360
  217.             TabIndex        =   27
  218.             Top             =   360
  219.             Width           =   1980
  220.             _ExtentX        =   3493
  221.             _ExtentY        =   1693
  222.             Style           =   3
  223.          End
  224.       End
  225.       Begin VB.OptionButton optSelect 
  226.          Caption         =   "Select"
  227.          Height          =   330
  228.          Index           =   1
  229.          Left            =   255
  230.          Style           =   1  'Graphical
  231.          TabIndex        =   5
  232.          Top             =   3000
  233.          Width           =   1185
  234.       End
  235.       Begin VB.Frame fraBorder 
  236.          Height          =   1560
  237.          Index           =   1
  238.          Left            =   150
  239.          TabIndex        =   4
  240.          Top             =   3105
  241.          Width           =   2565
  242.          Begin y2kCountDown.CountDown CountDown1 
  243.             Height          =   1155
  244.             Index           =   1
  245.             Left            =   240
  246.             TabIndex        =   25
  247.             Top             =   240
  248.             Width           =   1950
  249.             _ExtentX        =   3440
  250.             _ExtentY        =   2037
  251.             Style           =   1
  252.          End
  253.       End
  254.       Begin VB.Frame fraBorder 
  255.          Height          =   1560
  256.          Index           =   2
  257.          Left            =   3810
  258.          TabIndex        =   3
  259.          Top             =   3105
  260.          Width           =   2565
  261.          Begin y2kCountDown.CountDown CountDown1 
  262.             Height          =   1140
  263.             Index           =   2
  264.             Left            =   360
  265.             TabIndex        =   26
  266.             Top             =   240
  267.             Width           =   1980
  268.             _ExtentX        =   3493
  269.             _ExtentY        =   2011
  270.             Style           =   2
  271.          End
  272.       End
  273.       Begin VB.OptionButton optSelect 
  274.          Caption         =   "Select"
  275.          Height          =   330
  276.          Index           =   0
  277.          Left            =   255
  278.          Style           =   1  'Graphical
  279.          TabIndex        =   2
  280.          Top             =   225
  281.          Value           =   -1  'True
  282.          Width           =   1185
  283.       End
  284.       Begin VB.Frame fraBorder 
  285.          Height          =   2325
  286.          Index           =   0
  287.          Left            =   150
  288.          TabIndex        =   1
  289.          Top             =   330
  290.          Width           =   5385
  291.          Begin y2kCountDown.CountDown CountDown1 
  292.             Height          =   1890
  293.             Index           =   0
  294.             Left            =   120
  295.             TabIndex        =   24
  296.             Top             =   240
  297.             Width           =   5070
  298.             _ExtentX        =   8943
  299.             _ExtentY        =   3334
  300.             Style           =   0
  301.          End
  302.       End
  303.    End
  304. Attribute VB_Name = "frmMain"
  305. Attribute VB_GlobalNameSpace = False
  306. Attribute VB_Creatable = False
  307. Attribute VB_PredeclaredId = True
  308. Attribute VB_Exposed = False
  309. 'You can change the Style of the control with the syntax
  310. '   object.Style = Style_Flame
  311. 'where "object" is the name of the control
  312. 'There are seven styles, each shown on this form.  You will notice
  313. 'that this program takes a long time to load and unload.
  314. 'That is because there are so many of the controls on the form.
  315. 'Typically you would only use one or two on the form
  316. Private Sub Form_Load()
  317. Dim nCounter%
  318. 'start all the counters with the
  319. ' StartCounting Method
  320. For nCounter% = 0 To CountDown1.Count - 1
  321.     CountDown1(nCounter%).StartCounting
  322. Next nCounter%
  323. End Sub
  324. Private Sub optMode_Click(Index As Integer)
  325. Dim whichCtl%
  326. whichCtl% = GetSelectedControl
  327. Select Case Index
  328.     Case 0
  329.         'Change the Mode from NormalTime to CountDown
  330.         'with the mode property
  331.         CountDown1(whichCtl%).Mode = CountDown
  332.         'Show the Days count
  333.         CountDown1(whichCtl%).ShowDays = True
  334.     Case 1
  335.         'Change the Mode from CountDown to Normal
  336.         CountDown1(whichCtl%).Mode = NormalTime
  337.         'Hide the days count
  338.         CountDown1(whichCtl%).ShowDays = False
  339. End Select
  340. CountDown1(whichCtl%).Refresh
  341. End Sub
  342. Private Sub optSelect_Click(Index As Integer)
  343. optStartStop(0).Value = True
  344. optMode(0).Value = True
  345. optShowDays(0).Value = True
  346. CountDown1(Index).Refresh
  347. optShowDays_Click (0)
  348. optStartStop_Click (0)
  349. optStartStop_Click (0)
  350. CountDown1(Index).Refresh
  351. End Sub
  352. Private Sub optShowDays_Click(Index As Integer)
  353. Dim whichCtl%
  354. whichCtl% = GetSelectedControl
  355. Select Case Index
  356.     Case 0
  357.         CountDown1(whichCtl%).ShowDays = True
  358.     Case 1
  359.         CountDown1(whichCtl%).ShowDays = False
  360. End Select
  361. CountDown1(whichCtl%).Refresh
  362. End Sub
  363. Private Sub optStartStop_Click(Index As Integer)
  364. Dim whichCtl%
  365. whichCtl% = GetSelectedControl
  366. Select Case Index
  367.     Case 0
  368.         CountDown1(whichCtl%).StartCounting
  369.     Case 1
  370.         CountDown1(whichCtl%).StopCounting
  371. End Select
  372. End Sub
  373. Private Function GetSelectedControl() As Integer
  374. Dim nCounter%
  375. For nCounter% = 0 To optSelect.Count - 1
  376.     If optSelect(nCounter).Value = True Then
  377.         GetSelectedControl = nCounter
  378.         Exit For
  379.     End If
  380. Next nCounter%
  381. End Function
  382.